package com.huitone.gddw.service.dto;

import java.util.Date;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;
import com.huitone.gddw.dao.entity.InputLine;
import com.huitone.gddw.utils.DateTimeUtils;

/**
 * 文件导入明细 DTO 对象
 * @author wuluodan
 *
 */
public class InputLineDTO {

	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "")
	private Integer seq;
	
	private String recId;
	
	@ColToProperty
	@TabCol(Index = 2, title = "日期", width = "65")
	private String uptimeDate;
	
	@ColToProperty
	@TabCol(Index = 3, title = "导入文件名", width = "120")
	private String fileName;
	
	private String status;
	
	@ColToProperty
	@TabCol(Index = 4, title = "导入状态", width = "")
    private String statusStr;
	
	@ColToProperty
	@TabCol(Index = 5, title = "记录行号", width = "")
	private Integer lineNo;
	
	@ColToProperty
	@TabCol(Index = 6, title = "记录行内容", width = "120")
	private String lineContent;
	
	@ColToProperty
	@TabCol(Index = 7, title = "导入操作人", width = "65")
    private String userName;
	
	@ColToProperty
	@TabCol(Index = 8, title = "操作时间", width = "130")
	private Date insertTime;
	
	private String sendResult;

	public InputLineDTO() {}
	
	public InputLineDTO(InputLine entity) {
		this.setRecId(entity.getRecId());
		this.setStatus(entity.getStatus());
		this.setLineNo(entity.getLineNo());
		this.setLineContent(entity.getLineContent());
		this.setInsertTime(entity.getInsertTime());
	}
	
	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getRecId() {
		return recId;
	}

	public void setRecId(String recId) {
		this.recId = recId;
	}

	public String getUptimeDate() {
		return this.insertTime == null ? "" : DateTimeUtils.dateToStr(this.insertTime, "yyyy-MM-dd");
	}

	public void setUptimeDate(String uptimeDate) {
		this.uptimeDate = uptimeDate;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStatusStr() {
		if (null == this.status)
			return "未知";
		if (this.status.equals("0"))
			return "失败";
		if (this.status.equals("1"))
			return "成功";
		return "未知";
	}

	public void setStatusStr(String statusStr) {
		this.statusStr = statusStr;
	}

	public Integer getLineNo() {
		return lineNo;
	}

	public void setLineNo(Integer lineNo) {
		this.lineNo = lineNo;
	}

	public String getLineContent() {
		return lineContent;
	}

	public void setLineContent(String lineContent) {
		this.lineContent = lineContent;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Date getInsertTime() {
		return insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	public String getSendResult() {
		return sendResult;
	}

	public void setSendResult(String sendResult) {
		this.sendResult = sendResult;
	}
	
}
